package top.toptimus.dto.project.projectItem;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * WBS项目
 *
 * @author gaoyu
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class WBSItemDTO implements Comparable<WBSItemDTO> {
    private String id;  //  id
    private String parentId;    //  父id
    private String activityDescription;    //  名称
    private String code;  //  WBS编码顺序
    private int index;   //  顺序
    private List<AchievementTemplateDTO> achievementTemplateDTOS = new ArrayList<>();

    public WBSItemDTO(
            String id,
            String parentId,
            String activityDescription,
            String code
    ) {
        this.id = id;
        this.parentId = parentId;
        this.activityDescription = activityDescription;
        this.code = code;
    }

    /**
     * 测试方法
     *
     * @param code 编码
     */
    public WBSItemDTO(
            String code
    ) {
        this.id = code;
        this.code = code;
    }

    @Override
    public int compareTo(WBSItemDTO wbsItemDTO) {
        return this.getCode().compareTo(wbsItemDTO.getCode());
    }
}
